#ifndef STRING_OPERATIONS_H
#define STRING_OPERATIONS_H

#include <string>
#include <vector>
#include <sstream>
#include <locale>

class StringOperations
{
public:
    static void lowercase(std::string& aString);
    static void dos2unix(std::string& line);
    static void replace(std::string& aString, const std::string& toSearch, const std::string& toReplace);
    
    template<typename T>
    static void toNumeric(const std::string& aString, T& numeric)
    {
        std::stringstream ss(aString);
        ss >> numeric;
    }
    
    static void tokenize(const std::string& str, const std::string& delimiter, std::vector<std::string>& tokens);
	static void trim(std::string& str);
};

struct LowerCase
{
    std::string::value_type operator()(std::string::value_type& c)
    {
		return std::tolower(c, std::locale::classic());
    }
};

#endif
